<template>
  <div id="app">

    <div class="top">
      <div class="logo">
        <img src="../public/img/logo.png" alt="" />
      </div>
      <input type="text" placeholder="女心理师">
      <van-icon name="contact" />
    </div>

    <ul class="bottom">
      <li v-for="(item, index) in arr" :key="index" @click="fn_data(index)">
        <router-link :to="item.luyou">
          <p :class="{active:one===index}">{{item.name}}</p>
        </router-link>
      </li>
    </ul>

    <router-view />
    
  </div>
</template>

<script>
export default {
  name:"App",
  data(){
    return {
      one:0,
      arr:[
        {
          name:"首页",
          luyou:"/",

        },
        {
          name:"会员",
          luyou:"/member",
        },
        {
          name:"电视剧",
          luyou:"/teleplay",
        },
        {
          name:"电影",
          luyou:"/film",
        },
        {
          name:"综艺",
          luyou:"/variety",
        }
      ]
    }
  },
  methods:{
    fn_data(index){
      this.one=index;
    }
  }
}
</script>

<style scoped>
html,body{
  width: 7.5rem;
  overflow-x: hidden;
}
#app {
  width: 100%;
}
#app > .top {
  width: 100%;
  height: .96rem;
  background: #fff;
  display: flex;
  padding-top: .2rem;
  position: fixed;
  top: 0;
  z-index:99;
}
#app > .top>.logo{
  width: 2.4rem;
  height: .76rem;
  margin-left: .2rem;
}
#app > .top>.logo>img{
  width:100%;
  height: 100%;
}
#app >.top>input{
  width: 3.2rem;
  height: .66rem;
  line-height: .96rem;
  border-radius: 100px;
  margin-left:.2rem;
  border: 1px solid #ccc;
  padding-left: .4rem;
  font-size: .14rem;
  background: rgba(0, 0, 0, .06);
}
#app >.top >i{
  line-height: .66rem;
  font-size: .5rem;
  margin-left: .2rem;
}
#app .bottom{
  width: 100%;
  height: 1rem;
  display: flex;
  justify-content: space-around;
  background: #fff;
  justify-content: space-around;
  position: fixed;
  top: 1rem;
  z-index:99;
}
#app .bottom>li{
  line-height: 1rem;
  width: 20%;
  text-align: center;
  color: #333;
}
#app .bottom>li p{
  font-size: .4rem;
}
.active{
  border-bottom: .1rem solid #2ca2f9;
  color: #2ca2f9;
}
</style>
